package com.woniuxy.rabbit.simple;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author: 15489  <br/>
 * Date: 2022/4/6:14:42  <br/>
 * Description:
 */
@Component
public class Producter {
    @Resource
    private AmqpTemplate amqpTemplate; //rabbittemplate对象
    public  void send(String msg){
//  发消息
//        参数一消息队列的名字
//        参数二消息
        amqpTemplate.convertAndSend("simple_queue",msg);
    }
}
